package top.archiesean.sqlSession.impl;

import top.archiesean.pojo.Configuration;
import top.archiesean.sqlSession.SqlSession;
import top.archiesean.sqlSession.SqlSessionFactory;

/**
 * @author ArchieSean
 * @create 2023/7/11
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    /**
     * 创建sqlSession
     *
     * @return SqlSession
     */
    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration);
    }
}
